package com.zhongfeng.api.modules.white;

import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

/**
 * @author blueCat
 * @date 2023/2/3 9:40
 * @motto life is a gift
 */
public class dealA {
    public static void main(String[] args) throws IOException {
        //文件地址
        String location = "C:\\Users\\84361\\Desktop\\白名单";
        File file = new File("C:\\Users\\84361\\Desktop\\白名单");
        String[] list = file.list();
        //存储结果集
        List<String> result = new ArrayList<>();
        String filename = "";
        for (String s : list) {
            filename = location+"\\"+s;
            Scanner sc = new Scanner(new FileReader(filename));
            while (sc.hasNextLine()){
                String line = sc.nextLine();
                if (line.length() == 12 && (line.contains("0755611")||line.contains("0755610"))){
                    if (!result.contains(line)){
                        result.add(line);
                    }
                }
            }
        }
        FileWriter fw = new FileWriter(location + "\\合并号码集合.txt");
        for (String s : result) {
            fw.write(s+"\n");
        }
        fw.flush();
        fw.close();
    }
}
